Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add (i) tooltip button for More Info functionality on mobile devices & tooltip z-index fix #19144

Closed
wants to merge 1 commit into from

Conversation

k3a
Copy link
Contributor

@k3a k3a commented Dec 25, 2023

Breaking change

Proposed change

Some people complained that tapping on a chart to open More Info dialog instantly is not a common or expected behavior on mobile UIs.

Therefore this PR adjusts the functionality by introducing a tooltop-footer slot in the ha-chart-base component. This slot is then used by the state-history-chart-line and the state-history-chart-timeline to conditionally display a clickable (i) info button in the tooltip footer.

The decision to display this tooltip button is based on a type of native touch/mouse event which triggered onTap or onHover on the chart. For mouse events, the tooltip button is not visible and a click on a chart opens More Info directly (the current state). For non-mouse events, this (i) info button is displayed and can be additionally tapped on to display More Info.

The decision to use a clickable (i) tooltip button instead of just reacting to a tap on the tooltip itself was made because sometimes a tap on a tooltip is a valid action if there is a graph data point under the tooltip which a user wants to select. Therefore it is best to keep this functionality and just add this small clickable (i) instead.

ha-touch-moreinfo

Additionally, this PR also decreases the z-index CSS rule of the tooptip div from 1000 to 1 to prevent over-drawing of the sidebar or dialogs with chart tooltips.

I also set user-select CSS rule to none on the tooltip div to avoid selecting text on a tooltip in History panel.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@k3a k3a force-pushed the click-for-more-info-fixes branch 3 times, most recently from 829f453 to 6b63919 Compare December 25, 2023 14:39
…evices, lower z-index for tooltips to avoid overdrawing sidebar/dialogs
@k3a k3a force-pushed the click-for-more-info-fixes branch from 6b63919 to e39194b Compare December 25, 2023 15:21
@k3a k3a changed the title Adding (i) tooltip button for More Info functionality on mobile devices & tooltip z-index fix Add (i) tooltip button for More Info functionality on mobile devices & tooltip z-index fix Dec 26, 2023
@bramkragten bramkragten added the Needs UX Pull requests requiring a review from the Home Assistant design team label Dec 27, 2023
@bramkragten
Copy link
Member

I'm not sure about the icon in the footer of the tooltip, I do think the checking for mouse or touch event is good, mind if I take that out to put in the 2024.2 release?

@k3a
Copy link
Contributor Author

k3a commented Feb 1, 2024

That icon is a "button" on mobile, however it is not visible on desktop (when hovering the mouse pointer). On mobile, you may still tap anywhere else on the tooltip and have it propagate to the chart (to choose a different chart data point). Not having this button and only reacting to a tap on the tooltip would be bad UX-wise because it would prevent you from selecting other chart data points that are under it.

But I know that (i) icon is not the nicest thing. It expects that people would find out that it is tappable which I am not 100% sure. On the other hand, there is (i) on other places in HA, I use (i) in Developer Tools/States regularly. There are not that many alternative options. One option would be to have a link there with "More Info" text or something like that, I tried this initially but it looked too "noisy". I haven't tried to make its font smaller, though, but still, having a clickable link on tooltip seems worse to me.

As for me, I'm fine with the existing situation (without this PR), however other people complained in the connected problems, so I created this PR to make them happier. I'm not sure whether they are the majority. On the other hand, it really seem unusual that tapping on a chart opens a dialog.. I believe this PR will make everyone pleased, but I cannot guarantee it.

Removing access to More info on mobile entirely will make me force to use the current HA version forever (or update my personal fork every couple of years). But I can live with that, too. So whatever, you are the boss. :)

@bramkragten
Copy link
Member

I think putting an actionable item in the tooltip will always be a problem, as it might not be expected and could prevent the user from interacting with the chart, especially on small charts with big tooltips.

I will discuss this with our UX team.

@matthiasdebaat

@ColColonCleaner
Copy link

This is fantastic! I really dislike needing to hold and wait before releasing my finger when trying to read a value off the history graphs on mobile. If I release too early it jumps into the more info page of the entity I was already looking at. Leads to a loop of history -> info -> history -> info when I'm just trying to see the value of the graph at a specific point in time.
Tapping a button on the tooltip is great for mobile imo.

Copy link

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@github-actions github-actions bot added the stale label May 23, 2024
@ColColonCleaner
Copy link

Still would very much like to see this functionality.
While the recent changes that prevent accidentally opening the info page when reading values on graphs is great, it was very annoying accidentally doing that, now there isn't a way to do it intentionally on mobile at all. You now need to find the entity manually on another page or have an additional card.
An optional (i) button, or something equivalent, that lets you open the info page would be very nice.

@github-actions github-actions bot removed the stale label May 23, 2024
@matthiasdebaat
Copy link
Collaborator

Thanks @k3a for this PR! I've looked into this from a UX point of view. The problem, as I see it, is that it's not clear what will happen when you tap the graph on mobile. Our users would assume what would happen based on experience and different mental models. We have two options:

  • Open the more-info dialog for more details about the entity.
  • Show tooltip, which shows more accurate detailed information on the graph itself.

In the case of our history graph card, you can have multiple entities on one card. Right now, the more-info dialog of an entity opens when you tap the right little line. This is consistent with the design pattern that opens up more-info about an entity when you tap anywhere other than the action. But I think we should be coherent here.

I agree with your PR to always show the tooltip on tap. The primary function of the card is to display and compare data. Next step could be to get more details about the entity. Currently we break this flow.

I like that you made a difference between tap and click devices. Design wise I would suggest to have a clear label instead of the (i) icon. For example the text button with the label More info.

Copy link

github-actions bot commented Oct 3, 2024

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 3, 2024
Copy link
Contributor

coderabbitai bot commented Oct 3, 2024

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot closed this Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed Needs UX Pull requests requiring a review from the Home Assistant design team stale
Projects
None yet
4 participants